<?php
	if(!isset($_REQUEST['ajax'])){ $_REQUEST['ajax'] = "";}
	if($_REQUEST['ajax']!=true) include 'header.tpl.php';
?>
	<div class="row">
		<div class="col-lg-12">
    		<ul class="shortcut-buttons-set">
				<li>
					<a class="shortcut-button" href='#finance_technical'><span>
					<i class="aicon-salary_kt"></i>
					Lương kỹ thuật</span></a>
				</li>
				<li>
					<a class="shortcut-button" href='#finance_technical/type=CTV'><span>
					<i class="aicon-ctv"></i>
					Cộng tác viên</span></a>
				</li>
				<li>
					<a class="shortcut-button" href='#finance_technical_price'><span>
					<i class="aicon-salary_formula"></i>
					Thiết lập lương</span></a>
				</li>
			</ul>
    	</div>
	</div>
	<div class="row">
		<div class="col-lg-12">
			<div class="panel">
				<div class="panel-heading">
					<div class="panel-title"><i class="icon-cog"></i> <?php echo $this->language['list'];?></div>
				</div>
				<div class="panel-body">
					<form action="javascript:techFilter();" class="form-inline">
						<?php /*
						<div class="form-group">
							<select class="form-control" id="contract">
								<option value="">--- Tất cả ---</option>
								<?php foreach($this->contracts as $row):?>
								<option value="<?php echo $row['pContract'];?>" <?php echo (isset($_GET['contract']) && $_GET['contract'] == $row['pContract']) ? 'selected':'';?>><?php echo '['.date("d/m/Y",$row['pDeadTime']).'] '.$row['pName'];?></option>
								<?php endforeach;?>
							</select>
						</div> */ ?>
						<div class="form-group">
							<input type="text" id="date_start" class="form-control" placeholder="Bắt đầu">
						</div>
						<div class="form-group">
							<input type="text" id="date_end" class="form-control" placeholder="Kết thúc">
						</div>
						<button class="btn btn-primary" type="submit"><i class="icon-search"></i> Tìm</button>
						<!--<button class="btn btn-danger" onClick="pushTechSalary('<?php echo (isset($_GET['type']) && $_GET['type'] == 'CTV') ? 'CTV':'KTLED'; ?>');">Chốt lương</button>-->
					</form>
					<table class="footable table table-hover table-condensed">
						<thead>
							<tr>
								<th data-toggle="true" width="150px">Họ tên</th>
								<th class="text-center">Nhóm trưởng</th>
								<th class="text-center">Chạy chính</th>
								<th class="text-center">Chạy phụ</th>
								<th class="text-center">Kỹ thuật</th>
								<th class="text-center">Tháo</th>
								<th class="text-center">Lắp</th>
								<th class="text-center">Show đêm</th>
								<th class="text-center" data-hide="phone,tablet">Tài xế</th>
								<th class="text-center" data-hide="phone,tablet">TX đi tỉnh</th>
								<th class="text-center" data-hide="phone,tablet">TX show đêm</th>
							</tr>
						</thead>
						<tbody>
							<?php foreach($this->works as $row): ?>
							<tr>
								<td>
									<?php if($row['tech_user_type'] == 'KTLED'): ?><a href="#user_view/uId=<?php echo $row['tech_user_id'];?>"><?php echo $row['tech_user_name'];?></a>
									<?php else: ?><?php echo $row['tech_user_name'];?>
									<?php endif;?>
								</td>
								<td class="text-center"><?php echo ($row['works'][1]) ? '<span class="hint--left" data-hint="'.number_format(($row['works'][1] * $this->prices[0]['price']),0,'.',',').' VNĐ">'.$row['works'][1].'</span>' : '-';?></td>
								<td class="text-center"><?php echo ($row['works'][2]) ? '<span class="hint--left" data-hint="'.number_format(($row['works'][2] * $this->prices[1]['price']),0,'.',',').' VNĐ">'.$row['works'][2].'</span>' : '-';?></td>
								<td class="text-center"><?php echo ($row['works'][3]) ? '<span class="hint--left" data-hint="'.number_format(($row['works'][3] * $this->prices[2]['price']),0,'.',',').' VNĐ">'.$row['works'][3].'</span>' : '-';?></td>
								<td class="text-center"><?php echo ($row['works'][4]) ? '<span class="hint--left" data-hint="'.number_format(($row['works'][4] * $this->prices[3]['price']),0,'.',',').' VNĐ">'.$row['works'][4].'</span>' : '-';?></td>
								<td class="text-center"><?php echo ($row['works'][5]) ? '<span class="hint--left" data-hint="'.number_format(($row['works'][5] * $this->prices[4]['price']),0,'.',',').' VNĐ">'.$row['works'][5].'</span>' : '-';?></td>
								<td class="text-center"><?php echo ($row['works'][6]) ? '<span class="hint--left" data-hint="'.number_format(($row['works'][6] * $this->prices[5]['price']),0,'.',',').' VNĐ">'.$row['works'][6].'</span>' : '-';?></td>
								<td class="text-center"><?php echo ($row['works'][7]) ? '<span class="hint--left" data-hint="'.number_format(($row['works'][7] * $this->prices[6]['price']),0,'.',',').' VNĐ">'.$row['works'][7].'</span>' : '-';?></td>
								<td class="text-center"><?php echo ($row['works'][8]) ? '<span class="hint--left" data-hint="'.number_format(($row['works'][8] * $this->prices[7]['price']),0,'.',',').' VNĐ">'.$row['works'][8].'</span>' : '-';?></td>
								<td class="text-center"><?php echo ($row['works'][9]) ? '<span class="hint--left" data-hint="'.number_format(($row['works'][9] * $this->prices[8]['price']),0,'.',',').' VNĐ">'.$row['works'][9].'</span>' : '-';?></td>
								<td class="text-center"><?php echo ($row['works'][10]) ? '<span class="hint--left" data-hint="'.number_format(($row['works'][10] * $this->prices[9]['price']),0,'.',',').' VNĐ">'.$row['works'][10].'</span>' : '-';?></td>
							</tr>
							<?php endforeach;?>
						</tbody>
					</table>
				</div>
			</div>
		</div>
	</div>
	<link href="resources/css/footable.core.css" type="text/css" rel="stylesheet" />
	<script type="text/javascript" src="resources/scripts/jquery-ui.min.js"></script>
	<script type="text/javascript" src="resources/scripts/jquery.datePicker.js"></script>
	<script type="text/javascript" src="resources/scripts/footable.js"></script>
	<script>
		$('.footable').footable();
		$("#date_start").datepicker({dateFormat: 'dd-mm-yy'});
		$("#date_end").datepicker({dateFormat: 'dd-mm-yy'});
	</script>
<?php if(isset($this->breadcrumb) && isset($this->title_header)):?>
	<script type="text/javascript">
		$(function() {
			$("#title-header").text('<?php echo $this->title_header;?>');
			$("#breadcrumb").html('<?php echo build_breadcrumb($this->breadcrumb);?>');
		});
	</script>
<?php endif;?>
<?php
	if($_REQUEST['ajax']!=true) include 'footer.tpl.php';
?>